package backend.attribute.manager;

import org.hibernate.Session;

import core.attribute.model.AttributeValue;
import core.util.HibernateCoreUtil;

public class AttributeValueManager  extends HibernateCoreUtil
{
	public AttributeValue getAttributeValueByUuid(Long uuid)
	{
		Session session = HibernateCoreUtil.getSessionFactory().getCurrentSession();
		session.beginTransaction();
		AttributeValue av =  (AttributeValue)session.get(AttributeValue.class, uuid);
		session.getTransaction().commit();
		return av ;
	}
	public void save(AttributeValue av)
	{
		Session session = HibernateCoreUtil.getSessionFactory().getCurrentSession();
		session.beginTransaction();
		session.merge(av);
		session.getTransaction().commit();
	}
	public void delete(AttributeValue av)
	{
		Session session = HibernateCoreUtil.getSessionFactory().getCurrentSession();
		session.beginTransaction();
		session.delete(av);
		session.getTransaction().commit();
	}
}
